#include "example.h"
#include <QCoreApplication>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    Receiver *receiver = new Receiver();
    Sender *sender = new Sender();

    QObject::connect(sender, SIGNAL(mySignal(void)), receiver,
                     SLOT(mySlot(void)));
    QObject::connect(sender, SIGNAL(mySignal(const int &)), receiver,
                     SLOT(mySlot(const int &)));

    sender->EmitAllSignals();

    // disconnect with a certain signal
    sender->disconnect(SIGNAL(mySignal(void)));
    sender->EmitAllSignals();

    // disconnect with all signals of a certain object
    sender->disconnect(receiver);
    sender->EmitAllSignals();

    delete receiver;
    delete sender;

    return a.exec();
}
